<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>添加工资</title>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<jsp:include page="menu.jsp"/>
<div class="index-content">
    <div class="index-content-operation">
        <a class="info-detail">添加工资</a>
        <br>
        <br>
    </div>
    <br>
    <form action="SalaryServlet?action=add" method="post" onsubmit="return check()">
        <table class="index-content-table-add">
            <tr>
                <td width="12%">工号：</td><td><input class="index-content-table-td-add" type="text" id="salaryNo" name="salaryNo" value=""/></td>
            </tr>
            <tr>
                <td width="12%">部门：</td><td><input class="index-content-table-td-add" type="text" id="salaryDept" name="salaryDept" value=""/></td>
            </tr>
            <tr>
                <td width="12%">姓名：</td><td><input class="index-content-table-td-add" type="text" id="salaryName" name="salaryName" value=""/></td>
            </tr>
            <tr>
                <td width="12%">发放日期：</td><td><input class="index-content-table-td-add" type="text" id="salaryMonth" name="salaryMonth" value=""/></td>
            </tr>
            <tr>
                <td width="12%">基本工资：</td><td><input class="index-content-table-td-add" type="text" id="salaryBasic" name="salaryBasic" value=""/></td>
            </tr>
            <tr>
                <td width="12%">五险：</td><td><input class="index-content-table-td-add" type="text" id="fiveInsurances" name="fiveInsurances" value=""/></td>
            </tr>
            <tr>
                <td width="12%">公积金：</td><td><input class="index-content-table-td-add" type="text" id="accumulationFund" name="accumulationFund" value=""/></td>
            </tr>
            <tr>
                <td width="12%">加班工资：</td><td><input class="index-content-table-td-add" type="text" id="salaryOvertime" name="salaryOvertime" value=""/></td>
            </tr>
            <tr>
                <td width="12%">应发工资：</td><td><input class="index-content-table-td-add" type="text" id="salaryMoney" name="salaryMoney" value=""/></td>
            </tr>
            <tr>
                <td width="12%">实发工资：</td><td><input class="index-content-table-td-add" type="text" id="salaryReal" name="salaryReal" value=""/></td>
            </tr>
            <tr>
                <td width="12%">备注：</td><td><textarea id="salaryText" name="salaryText" style="width: 60%; height: 100px;padding: 0px 17px;" placeholder="请输入内容......"></textarea></td>
            </tr>
        </table>
        <br>
        <br>
        <br>
        &nbsp;&nbsp;&nbsp;<button type="submit" class="btn btn-3d btn-pill btn-success btn-sm">提交</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" class="btn btn-3d btn-pill btn-success btn-sm" onclick="javascript:history.back(-1);">取消</button>
    </form>
</div>

</body>
<script type="text/javascript">
    //提交之前进行检查，如果return false，则不允许提交
    function check() {
        //根据ID获取值
        var salaryNo = document.getElementById("salaryNo").value;
        if (salaryNo == "") {
            alert("工号不能为空");
            return false;
        }
        var salaryDept = document.getElementById("salaryDept").value;
        if (salaryDept == "") {
            alert("部门不能为空");
            return false;
        }
        var salaryName = document.getElementById("salaryName").value;
        if (salaryName == "") {
            alert("姓名不能为空");
            return false;
        }
        var salaryMonth = document.getElementById("salaryMonth").value;
        if (salaryMonth == "") {
            alert("日期不能为空");
            return false;
        }
        var salaryBasic = document.getElementById("salaryBasic").value;
        if (salaryBasic == "") {
            alert("基本工资不能为空");
            return false;
        }
        var fiveInsurances = document.getElementById("fiveInsurances").value;
        if (fiveInsurances == "") {
            alert("五险不能为空");
            return false;
        }
        var accumulationFund = document.getElementById("accumulationFund").value;
        if (accumulationFund == "") {
            alert("公积金不能为空");
            return false;
        }
        var salaryOvertime = document.getElementById("salaryOvertime").value;
        if (salaryOvertime == "") {
            alert("加班工资不能为空");
            return false;
        }
        var salaryMoney = document.getElementById("salaryMoney").value;
        if (salaryMoney == "") {
            alert("应发工资不能为空");
            return false;
        }
        var salaryReal = document.getElementById("salaryReal").value;
        if (salaryReal == "") {
            alert("实发工资不能为空");
            return false;
        }
        return true;
    }
</script>
</html>
